package com.ruoyi.disasterassessment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.disasterassessment.mapper.IotWarningMapper;
import com.ruoyi.disasterassessment.domain.IotWarning;
import com.ruoyi.disasterassessment.service.IIotWarningService;

/**
 * 数据测点告警Service业务层处理
 * 
 * @author hcc
 * @date 2023-12-21
 */
@Service
public class IotWarningServiceImpl implements IIotWarningService 
{
    @Autowired
    private IotWarningMapper iotWarningMapper;

    /**
     * 查询数据测点告警
     * 
     * @param id 数据测点告警主键
     * @return 数据测点告警
     */
    @Override
    public IotWarning selectIotWarningById(Long id)
    {
        return iotWarningMapper.selectIotWarningById(id);
    }

    /**
     * 查询数据测点告警列表
     * 
     * @param iotWarning 数据测点告警
     * @return 数据测点告警
     */
    @Override
    public List<IotWarning> selectIotWarningList(IotWarning iotWarning)
    {
        return iotWarningMapper.selectIotWarningList(iotWarning);
    }

    /**
     * 新增数据测点告警
     * 
     * @param iotWarning 数据测点告警
     * @return 结果
     */
    @Override
    public int insertIotWarning(IotWarning iotWarning)
    {
        iotWarning.setCreateTime(DateUtils.getNowDate());
        return iotWarningMapper.insertIotWarning(iotWarning);
    }

    /**
     * 修改数据测点告警
     * 
     * @param iotWarning 数据测点告警
     * @return 结果
     */
    @Override
    public int updateIotWarning(IotWarning iotWarning)
    {
        iotWarning.setUpdateTime(DateUtils.getNowDate());
        return iotWarningMapper.updateIotWarning(iotWarning);
    }

    /**
     * 批量删除数据测点告警
     * 
     * @param ids 需要删除的数据测点告警主键
     * @return 结果
     */
    @Override
    public int deleteIotWarningByIds(Long[] ids)
    {
        return iotWarningMapper.deleteIotWarningByIds(ids);
    }

    /**
     * 删除数据测点告警信息
     * 
     * @param id 数据测点告警主键
     * @return 结果
     */
    @Override
    public int deleteIotWarningById(Long id)
    {
        return iotWarningMapper.deleteIotWarningById(id);
    }
}
